<style type="text/css">
<!--
p{font-size: 12px}
#myform ul{display:block; overflow:hidden; margin: 10px 0}
#myform ul li{width: 90px; list-style: none; float: left; font-size: 12px}
-->
</style>
<form id="myform" action="<?php echo $this->baseUrl().'/admin/character-setup/insert-character'?>" method="post">
<input type="hidden" name="numiid" id="numiid" value="">
<h1>temp taobao list</h1>
<?php if (count($this->paginator)): ?>
<table>
<?php foreach ($this->paginator as $item): ?>
  <tr>
	<td height="300px">
		<img alt="" src="<?php echo $item['pic_url']; ?>_200x200.jpg" width="200px" height="200px" />
	</td>
	<td width="100%" valign="top">
		<p>名称：<a href="<?php echo $item['click_url']?>" target="_blanks"><?php echo $item['title']?></a></p>
		<p>价格：<?php echo $item['price']?> </p>
		<?php if(1==$item['is_promotion']){?>
		<p>促销名称：<?php echo $item['promotion_name']?>&nbsp;促销价格：<?php echo $item['promotion_price']?>促销结束时间：<?php echo $item['promotion_end_time']?></p>
		<?php }?>
		<?php if(1==$item['is_taobaoke']){?>
		<p>淘宝客商品</p>
		<?php }?>
		<hr/>
		<ul>
		<?php foreach($this->level0 as $level0Character){?>
		<li><input type="checkbox" name="<?php echo $item['num_iid'].'_level0[]'?>" value="<?php echo $level0Character['name']?>" 
		<?php if(stristr($item['level0'], $level0Character['name']) ){?>
			checked="checked"
		<?php }?>
		><?php echo $level0Character['name']?></li>
		<?php }?>
		</ul>
		<ul>
		<?php foreach($this->level1 as $level1Character){?>
		<li><input type="checkbox" name="<?php echo $item['num_iid'].'_level1[]'?>" value="<?php echo $level1Character['name']?>"
		<?php if(stristr($item['level1'], $level1Character['name']) ){?>
			checked="checked"
		<?php }?>
		><?php echo $level1Character['name']?></li>
		<?php }?>
		</ul>
		<ul>
		<?php foreach($this->level2 as $level2Character){?>
		<li><input type="checkbox" name="<?php echo $item['num_iid'].'_level2[]'?>" value="<?php echo $level2Character['name']?>"
		<?php if(stristr($item['level2'], $level2Character['name']) ){?>
			checked="checked"
		<?php }?>
		><?php echo $level2Character['name']?></li>
		<?php }?>
		</ul>
		<ul>
		<?php foreach($this->level3 as $level3Character){?>
		<li><input type="checkbox" name="<?php echo $item['num_iid'].'_level3[]'?>" value="<?php echo $level3Character['name']?>"
		<?php if(stristr($item['level3'], $level3Character['name']) ){?>
			checked="checked"
		<?php }?>
		><?php echo $level3Character['name']?></li>
		<?php }?>
		</ul>
		<ul>
		<?php foreach($this->level4 as $level4Character){?>
		<li><input type="checkbox" name="<?php echo $item['num_iid'].'_level4[]'?>" value="<?php echo $level4Character['name']?>"
		<?php if(stristr($item['level4'], $level4Character['name']) ){?>
			checked="checked"
		<?php }?>
		><?php echo $level4Character['name']?></li>
		<?php }?>
		</ul>
		<input type="button" value="插入" onclick="insert(<?php echo $item['num_iid']?>)"> <input type="button" value="更新" onclick="update(<?php echo $item['num_iid']?>)"> 
		</td>  	
  </tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php echo $this->paginationControl($this->paginator,
                                    'Sliding',
                                    'my_pagination_control.phtml'); ?>
</form>
<br /><br /><center>View script for controller <b>TaoBaoItems</b> and script/action name <b>listTempItems</b></center>
<script>
function insert(numiid){

	$("#numiid").val(numiid);
	$("#myform").submit();
}

function update(numiid){
	alert(numiid);
}
</script>
